from socket import gethostbyname, gaierror


def ip_check(url):
    try:
        ip = gethostbyname(url)
    except gaierror:
        print("")
    except Exception as error:
        print(f"未知错误：{error}")
    else:
        return ip


if __name__ == '__main__':
    print(ip_check('www.taobao.com'))
